﻿using System;
using System.Diagnostics;
using Mbs.Configuration;

namespace Mbs.Modularity.AddIns
{ 
    [Serializable]
    [DebuggerDisplay("BaseResourceName={BaseResourceName},ResourceFile={ResourceFile}")]
    class ResourceItem:IResourceItem
    {
        public string BaseResourceName { get; set; }
        public string ResourceFile { get; set; }
        public string AssemblyFile { get; set; }

        public ResourceItem() { }
        public ResourceItem(INode node)
        {
            BaseResourceName = node.Attributes.Get("BaseResourceName") as string;
            AssemblyFile = node.Attributes.Get("AssemblyFile") as string;
            ResourceFile = node.Value;
            node = null;
        }
        public IResourceItem Clone()
        {
            return new ResourceItem
            {
                BaseResourceName = this.BaseResourceName,
                ResourceFile = this.ResourceFile,
                AssemblyFile = this.AssemblyFile,
            };
        }

        object ICloneable.Clone()
        {
            return Clone();
        }
    }
}
